#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@File ：AddressParser.py
@Author ：zqy
@Email : zqingy@work@163.com 
@note: 
"""

from application.Parser import BaseValidator, JSONRequestParser


class AddressValidator(BaseValidator):

    @classmethod
    def post(cls)-> JSONRequestParser:
        p = JSONRequestParser(trim=True)
        p.add_argument_required_non_null("contact_name", type=str, help="收件人名称")
        p.add_argument_required_non_null("contact_phone", type=str, help="收件人电话")
        p.add_argument_required_non_null("full_address", type=str, help="完整地址")
        p.add_argument("is_default", type=bool, help="是否是默认地址")
        return p
